<template>
	<view class="padb20">
		<stop isBack>
			<view slot="content">设备信息盘点</view>
		</stop>
		<view>
			<stab :names="['基本信息','关联信息']" v-model="myCurTab"></stab>
		</view>
		<view class="">
			<view v-show="myCurTab == 0">
				<view class="lh2 bcf pad2 mart3">
					<spic label="主图" placeholder="" v-model="en.pic"></spic>
				</view>
				<view class="lh2 bcf pad2 mart3">
					<stext label="名称"  v-model="en.name"></stext>
				</view>
				<view class="lh2 bcf pad2 mart3">
					<stext label="编号"  v-model="en.code"></stext>
				</view>
				<view class="lh2 bcf pad2 mart3">
					<stext label="型号"  v-model="en.sn"></stext>
				</view>
				
				<view class="lh2 bcf pad2 mart3">
					<stext label="资产净值"  v-model="en.priceCurrent"></stext>
				</view>
				<view class="lh2 bcf pad2 mart3">
					<stext label="资产原值"  v-model="en.priceOrigin"></stext>
				</view>
			</view>
			<view v-show="myCurTab == 1">
				
				<view class="lh2 bcf pad2 mart3">
					<sentity label="设备标记" model="MachineMark" placeholder="请选择" v-model="en.mark"></sentity>
				</view>
				<view class="lh2 bcf pad2 mart3">
					<sentity label="设备标记" model="MachineCategory" placeholder="请选择" v-model="en.category"></sentity>
				</view>
				<view class="lh2 bcf pad2 mart3">
					<sentity label="设备分组" model="MachineGroup" placeholder="请选择" v-model="en.groups"></sentity>
				</view>
				
				
				<view class="lh2 bcf pad2 mart3">
					<stree label="所属部门" model="Department" placeholder="请选择" v-model="en.department"></stree>
				</view>
				<view class="lh2 bcf pad2 mart3">
					<stree label="维修班组" model="Department" placeholder="请选择" v-model="en.repairBy"></stree>
				</view>
				<view class="lh2 bcf pad2 mart3">
					<suser label="负责人"  v-model="en.operator" placeholder="请选择"></suser>
				</view>
			</view>
			<view class="pad3 pos-f b0 l0 r0 bcf">
				<!-- <view class="cu-btn lg tac line-green pos-r round w100" @tap="">
					开始盘点
					<ripple></ripple>
				</view> -->
				<ssubmit model="machines" v-model="en" :callback="saveDone">确认</ssubmit>
			</view>
		</view>
		<loading :loading="myIsLoading"></loading>
	</view>
</template>

<script>
	import machinePicker from '../../templete/machine/machine_picker.vue'
	export default {
		
		components:{machinePicker},
		data() {
			return {
				id:'',
				curTab:0,
				en:''
			}
		},
		methods: {
			saveDone(res){
				this.log(res)
				if(res.s == 1){
					this.$com.showToast('已保存')
				}
			}
		},
		onLoad(option) {
			this.id = option.id
			this.$api.res('machines',this.id,res=>{
				this.en = res
				this.clearLoading()
			})
		}
	}
</script>

<style>

</style>
